home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20041116-20060924 / 000045_m.g.walker@NOmassey.SPac.AMnz_Fri Feb 4 12:19:21 2005.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Path: newsmaster.cc.columbia.edu!panix!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail
  2. From: Matthew Walker <m.g.walker@NOmassey.SPac.AMnz>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: Terminating a telnet session
  5. Date: Fri, 04 Feb 2005 16:21:03 +1300
  6. Organization: Ihug Limited
  7. Lines: 56
  8. Message-ID: <ctupi6$uru$1@lust.ihug.co.nz>
  9. NNTP-Posting-Host: 203-173-172-66.bliink.ihug.co.nz
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=ISO-8859-1; format=flowed
  12. Content-Transfer-Encoding: 7bit
  13. X-Trace: lust.ihug.co.nz 1107487110 31614 203.173.172.66 (4 Feb 2005 03:18:30 GMT)
  14. X-Complaints-To: abuse@ihug.co.nz
  15. NNTP-Posting-Date: Fri, 4 Feb 2005 03:18:30 +0000 (UTC)
  16. User-Agent: Mozilla Thunderbird 1.0 (X11/20041206)
  17. X-Accept-Language: en-us, en
  18. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15280
  19.  
  20. Hi,
  21.  
  22. I'm trying to nicely/cleanly terminate a telnet session, but I'm unsure 
  23. how to do this with c-kermit 8.0.209.
  24.  
  25. I'm polling a telnet server every five minutes, and have discovered
  26. that after a few hours the server doesn't take any more connections.  I
  27. suspect that's because I was just closing each connection, rather than
  28. using the server's "logoff" command.
  29.  
  30. I've added a logoff command to my script.  My first problem is that
  31. even if I wait for the "Logging off." text from the server, kermit
  32. still closes the connection before the server closes its end.
  33.  
  34. In an attempt to fix that problem, I added a "bye" command at the very
  35. end of the script.  However, now the "bye" command fails (I assume)
  36. because the connection has closed by the time the "bye" is executed.
  37.  
  38. Is there some way to ask kermit to wait until the connection is closed?
  39.  
  40. Thanks for your thoughts,
  41.  
  42. Matthew
  43.  
  44.  
  45. Script copied below:
  46.  
  47. #!/usr/bin/kermit +
  48.  
  49. set host 192.168.1.1
  50.  
  51. set input echo on
  52.  
  53. input 10 Login:
  54. if failure exit 1 No login prompt
  55. output [username]\13
  56.  
  57. input 10 Password:
  58. if failure exit 1 No password prompt
  59. output [password]\13
  60.  
  61. input 10 -->
  62. if failure exit 1 No command line prompt
  63. output ip list interfaces\13
  64.  
  65. input 10 -->
  66. if failure exit 1 No command prompt after listing interfaces
  67. output user logout\13
  68.  
  69. input 10 Logging out.
  70. if failure exit 1 Failure to correctly close connection (didn't receive 
  71. text)
  72.  
  73. bye
  74. if failure exit 1 Failure to correctly close connection ('bye' errored)
  75. if success exit 0 Success